<?php

class User_notifyController extends BaseController
{
    public function infoAction() {
        Response::ajax(200, 'success', 
                self::model('user_notify')->getInfo($this->user_info['uid']));
    }
    
    public function listAction() {
        $uid = $this->user_info['uid'];
        $type = intval(Request::getParams('type'));
        $page = intval(Request::getParams('page', 1));
        $pageSize = intval(Request::getParams('pageSize', 20));
        Response::ajax(200, 'success', 
                self::model('notify')->getList($uid, $type, $page, $pageSize));
    }
    
    public function callbackAction() {
        $uid = $this->user_info['uid'];
        $type = intval(Request::getParams('type'));
        Response::ajax(200, 'success', self::model('user_notify')->clear($uid, $type));
    }
}